/*
package com.starshineworks.util;

import com.starshineworks.entities.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
//import java.util.Collections;
//import java.util.Date;

public class EntityFilter {

    final static String[] inputType = {};
    final static String[] numSel    = {};

    Integer                 menuId;
    Integer                 rowId;
    Map<String, String[]>   m;
    
    public EntityFilter(Integer rid, Integer mid, Map<String, String[]> map)
    {
        menuId = mid;
        rowId  = rid;
        m      = map;
    }

    public List<String[]> getAvailableObjects(String type) 
    {
        if (type.equalsIgnoreCase("field")) {
            return getAvailableFields();
        }
        if (type.equalsIgnoreCase("time")) {
            return getAvailableTimes();
        }
        if (type.equalsIgnoreCase("day")) {
            return getAvailableDays();
        }
        return null;
    }
    
    public List<String[]> getAvailableDays() 
    {
        final ArrayList<String[]> t = new ArrayList<String[]>();
        String[] var = {"0", "0",         "_day"};
        String[] mon = {"1", "Monday",    "Mon"};
        String[] tue = {"2", "Tuesday",   "Tue"};
        String[] wed = {"3", "Wednesday", "Wed"};
        String[] thu = {"4", "Thursday",  "Thu"};
        String[] fri = {"5", "Friday",    "Fri"};
        t.add(var);
        t.add(mon);
        t.add(tue);
        t.add(wed);
        t.add(thu);
        t.add(fri);
        return t;
    }
    
    public List<String[]> getAvailableFields() 
    {
        List<String[]> list = new ArrayList<String[]>();
        List<EntityE> ff = EntityE.retrieve(new FieldE());
        Integer i = 1;
        for (EntityE e : ff) {
            FieldE f = (FieldE)e;
            String[] triple = {i.toString(),f._name,f._name};
            list.add(triple);
            i++;
        }
        String[] top = {"0", "0", "_field"};
        list.add(0, top);
        return list; 
    }

    public List<String[]> getAvailableTimes() 
    {
        FieldE f = new FieldE();
        String[] slot = {"ERROR"};
        try {
            String fieldName = m.get("_field"+rowId+"[]")[0];
            f._name = fieldName;
            f = (FieldE)EntityE.retrieve(f).get(0);
            slot = f._times;
        }
        catch (Exception e) {
            Util.handleException(e);
        }
        List<String[]> list = new ArrayList<String[]>();
        Integer i = 1;
        for (String s : slot) {
            String[] triple = {i.toString(), s, s};
            list.add(triple);
            i++;
        }
        String[] other = {i.toString(), "Other", "Other"};
        list.add(other);
        String[] top = {"0", "0", "_time"};
        list.add(0, top);
        return list; 
    }

    /* XXXXX
     * public final List<String[]> getAvailableDates() {
        String[] t = {"date","8/20-12/23","8/24-12/10","8/2-12/30"};
        List list = new ArrayList();
        Collections.addAll(list, t); 
        return list;        
    }
    */

    /*
    public List<String> getAvailablefSessions() 
    {
        String[] t = {"_sessions","1","2","3"};
        List list = new ArrayList();
        Collections.addAll(list, t); 
        return list;        
    }*/

//}
